package com.lxd.order.mapper;

import com.lxd.order.pojo.Consume;
import com.lxd.order.pojo.MqLog;
import com.lxd.order.pojo.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface OrderMapper {

    @Select("select * from tb_order where id = #{id}")
    Order findById(Long id);
    @Insert("insert into mq_log(user_id,money,status)values(#{userId},#{money},'unfinished')")
    void insertMqLog(Consume consume);
    @Select("select * from mq_log where status = #{status}")
    List<MqLog> selectMqLog(String status);
    @Update("update mq_log set status = 'finished' where id = #{id}")
    void updateMqLog(Integer id);
}
